package com.yifeng.repo.micro.service.server.auth.sso.api;

import feign.Param;
import feign.RequestLine;
import next.fire.sso.api.model.*;
import next.fire.sso.api.model.page.PageData;
import next.fire.sso.api.model.query.*;
import next.fire.sso.api.model.response.BusJoinResponse;
import next.fire.sso.api.model.result.Result;
import next.fire.sso.api.model.userchange.UserChangeBO;
import next.fire.sso.api.model.userchange.UserChangeVO;
import next.framework.page.PageResult;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;
import java.util.Map;

/**
 * SsoClient
 * create by zyh 2022.08.24
 */
@FeignClient(name = "sso", url = "${yfcloud.micro.service.sso.url}", path = "/fire/fire-sso")
public interface SsoClient extends SsoServices {
    /**
     * UserFaceImageService
     */
    @Override
    @RequestLine("POST /api/UserFaceImageService/faceRecognition")
    boolean faceRecognition(@Param("userNumber") String userNumber, @Param("matchImage") String matchImage);

    /**
     * MerchantService
     */
    @Override
    @RequestLine("POST /api/MerchantService/getMerchant")
    Merchant getMerchant(@Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/MerchantService/getMerchantByCode")
    Merchant getMerchantByCode(@Param("code") String code);

    @Override
    @RequestLine("POST /api/MerchantService/listMerchantByCode")
    List<Merchant> listMerchantByCode(@Param("merchantCodes") List<String> merchantCodes);

    @Override
    @RequestLine("POST /api/MerchantService/listOpenMerchantPage")
    PageResult<Merchant> listOpenMerchantPage(@Param("orgQuery") OrgQuery orgQuery, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    /**
     * MessageService
     */
    @Override
    @RequestLine("POST /api/MessageService/pushMessage")
    String pushMessage(@Param("message") Message message);

    @Override
    @RequestLine("POST /api/MessageService/pushMessages")
    List<String> pushMessages(@Param("messages") List<Message> messages);

    @Override
    @RequestLine("POST /api/MessageService/destroyMessage")
    boolean destroyMessage(@Param("messageId") String messageId);

    @Override
    @RequestLine("POST /api/MessageService/destroyMessageByOuterCode")
    boolean destroyMessageByOuterCode(@Param("outerCode") String outerCode);

    @Override
    @RequestLine("POST /api/MessageService/listMessage")
    MessageBody listMessage(@Param("number") String number, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/MessageService/listMessageByOffset")
    MessageBody listMessageByOffset(@Param("merchantId") String merchantId, @Param("number") String number, @Param("messageId") String messageId, @Param("offset") int offset);

    /**
     * OrgService
     */
    @Override
    @RequestLine("POST /api/OrgService/allOrg")
    List<Org> allOrg(@Param("orgQuery") OrgQuery orgQuery);

    @Override
    @RequestLine("POST /api/OrgService/getOrg")
    Org getOrg(@Param("orgId") String orgId);

    @Override
    @RequestLine("POST /api/OrgService/getOrgByCode")
    Org getOrgByCode(@Param("code") String code, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/OrgService/listAllOrg")
    List<Org> listAllOrg(@Param("merchantId") String merchantId, @Param("type") String type);

    @Override
    @RequestLine("POST /api/OrgService/listAllOrg")
    List<Org> listAllOrg(@Param("merchantId") String merchantId, @Param("type") String type, @Param("lastModify") String lastModify);

    @Override
    @RequestLine("POST /api/OrgService/listAllOrgByOrgId")
    List<Org> listAllOrgByOrgId(@Param("orgId") String orgId);

    @Override
    @RequestLine("POST /api/OrgService/listStoreCodeByOrgId")
    List<String> listStoreCodeByOrgId(@Param("orgId") String orgId);

    @Override
    @RequestLine("POST /api/OrgService/listOrgByOrgIds")
    List<Org> listOrgByOrgIds(@Param("orgIds") String orgIds);

    @Override
    @RequestLine("POST /api/OrgService/listChildOrg")
    List<Org> listChildOrg(@Param("orgId") String orgId, @Param("type") String type);

    @Override
    @RequestLine("POST /api/OrgService/countUserByOrgId")
    int countUserByOrgId(@Param("orgId") String orgId);

    @Override
    @RequestLine("POST /api/OrgService/countAllOrgByParams")
    int countAllOrgByParams(@Param("orgQuery") OrgQuery orgQuery);

    @Override
    @RequestLine("POST /api/OrgService/listOrgByUserId")
    List<Org> listOrgByUserId(@Param("userId") String userId);

    @Override
    @RequestLine("POST /api/OrgService/listOrgByNumber")
    Org listOrgByNumber(@Param("number") String number, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/OrgService/changeOrg")
    void changeOrg(@Param("id") String id);

    @Override
    @RequestLine("POST /api/OrgService/getOrgByUserId")
    List<Org> getOrgByUserId(@Param("userId") String userId, @Param("hierarchy") String hierarchy);

    @Override
    @RequestLine("POST /api/OrgService/getOrgByLevel")
    List<Org> getOrgByLevel(@Param("levelQuery") LevelQuery levelQuery);

    @Override
    @RequestLine("POST /api/OrgService/getOrgTreeNodeByLevel")
    List<OrgTreeNode> getOrgTreeNodeByLevel(@Param("levelQuery") LevelQuery levelQuery);

    @Override
    @RequestLine("POST /api/OrgService/getOrgByUserIdStore")
    List<Org> getOrgByUserIdStore(@Param("userId") String userId, @Param("storeIdName") String storeIdName);

    @Override
    @RequestLine("POST /api/OrgService/getOrgByUserIdAndStore")
    List<Org> getOrgByUserIdAndStore(@Param("userId") String userId, @Param("storeIdName") String storeIdName);

    @Override
    @RequestLine("POST /api/OrgService/getOrgUserByUserId")
    Map<String, Object> getOrgUserByUserId(@Param("userId") String userId);

    @Override
    @RequestLine("POST /api/OrgService/getOrgByparms")
    Map<String, Object> getOrgByparms(@Param("parmsQuery") UserQuery parmsQuery);

    @Override
    @RequestLine("POST /api/OrgService/getStoreCodeByNumber")
    List<String> getStoreCodeByNumber(@Param("number") String number, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/OrgService/listOrgByNameOrCode")
    List<Org> listOrgByNameOrCode(@Param("name") String name, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/OrgService/getStoreByNumber")
    Org getStoreByNumber(@Param("number") String number);

    @Override
    @RequestLine("POST /api/OrgService/getOrgIdByStoreCode")
    Org getOrgIdByStoreCode(@Param("storeCode") String storeCode);

    @Override
    @RequestLine("POST /api/OrgService/getStoreDeptManagerByCode")
    User getStoreDeptManagerByCode(@Param("levelQuery") LevelQuery levelQuery);

    @Override
    @RequestLine("POST /api/OrgService/getStoreUserByStoreCode")
    List<User> getStoreUserByStoreCode(@Param("storeCode") String storeCode);

    @Override
    @RequestLine("POST /api/OrgService/getCompany")
    Org getCompany(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/OrgService/getOrgStoreTreeNodeByLevel")
    List<OrgTreeNode> getOrgStoreTreeNodeByLevel(@Param("levelQuery") LevelQuery levelQuery);

    @Override
    @RequestLine("POST /api/OrgService/getOrgStoreByLevel")
    List<OrgTreeNode> getOrgStoreByLevel(@Param("levelQuery") LevelQuery levelQuery);

    @Override
    @RequestLine("POST /api/OrgService/getAdministrativeCompanyList")
    List<Org> getAdministrativeCompanyList();

    @Override
    @RequestLine("POST /api/OrgService/getOrgListByParams")
    List<Org> getOrgListByParams(@Param("orgPrams") Org orgPrams);

    @Override
    @RequestLine("POST /api/OrgService/getOrgListByOrgCode")
    List<Org> getOrgListByOrgCode(@Param("orgPrams") LevelQuery orgPrams);

    /**
     * OuterSecondmentService
     */
    @Override
    @RequestLine("POST /api/OuterSecondmentService/handleList")
    String handleList(@Param("appSecret") String appSecret, @Param("list") List<OuterSecondment> list);

    @Override
    @RequestLine("POST /api/OuterSecondmentService/query")
    List<OuterSecondment> query(@Param("outerSecondmentQuery") OuterSecondmentQuery outerSecondmentQuery);

    /**
     * PostService
     */
    @Override
    @RequestLine("POST /api/PostService/list")
    List<Post> list(@Param("code") String code, @Param("name") String name, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/PostService/getPostInfo")
    List<Post> getPostInfo(@Param("post") Post post);

    @Override
    @RequestLine("POST /api/PostService/getPostInfoByNumber")
    Post getPostInfoByNumber(@Param("number") String number);

    @Override
    @RequestLine("POST /api/PostService/getPostByOrgCode")
    List<Post> getPostByOrgCode(@Param("orgQuery") OrgQuery orgQuery);

    /**
     * RoleService
     */
    @Override
    @RequestLine("POST /api/RoleService/getRoles")
    List<Role> getRoles(@Param("userCode") String userCode);

    @Override
    @RequestLine("POST /api/RoleService/getRolesByNumber")
    List<Role> getRolesByNumber(@Param("number") String number);

    @Override
    @RequestLine("POST /api/RoleService/getAllRoles")
    List<Role> getAllRoles(@Param("appId") String appId, @Param("merchantId") String merchantId);

    /**
     * SecurityService
     */
    @Override
    @RequestLine("POST /security/SecurityService/listMenuByToken")
    List<Menu> listMenuByToken(@Param("token") String token);

    @Override
    @RequestLine("POST /security/SecurityService/isAllowAccess")
    boolean isAllowAccess(@Param("device") String device, @Param("token") String token, @Param("menu") Menu menu);

    @Override
    @RequestLine("POST /security/SecurityService/isAllowAccessUrl")
    boolean isAllowAccessUrl(@Param("device") String device, @Param("token") String token, @Param("url") String url);

    @Override
    @RequestLine("POST /security/SecurityService/buildToken")
    String buildToken(@Param("userCode") String userCode, @Param("device") String device, @Param("token") Token token);

    @Override
    @RequestLine("POST /security/SecurityService/listTreeModuleAndFunc")
    List<Menu> listTreeModuleAndFunc(@Param("number") String number, @Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /security/SecurityService/listTreeModuleAndFuncByAppId")
    List<Menu> listTreeModuleAndFuncByAppId(@Param("number") String number, @Param("merchantId") String merchantId, @Param("appId") String appId);

    @Override
    @RequestLine("POST /security/SecurityService/listFunction")
    List<Function> listFunction(@Param("userAuthorization") UserAuthorization userAuthorization);

    @Override
    @RequestLine("POST /security/SecurityService/authFunction")
    boolean authFunction(@Param("userAuthorization") UserAuthorization userAuthorization);

    @Override
    @RequestLine("POST /security/SecurityService/checkToken")
    Result<Token> checkToken(@Param("userToken") String userToken, @Param("device") String device);

    /**
     * StoreService
     */
    @Override
    @RequestLine("POST /api/StoreService/getStore")
    List<Store> getStore(@Param("storeQuery") StoreQuery storeQuery);

    @Override
    @RequestLine("POST /api/StoreService/getSalesVolumeCode")
    List<Store> getSalesVolumeCode();

    @Override
    @RequestLine("POST /api/StoreService/getProprietorshipCode")
    List<Store> getProprietorshipCode();

    @Override
    @RequestLine("POST /api/StoreService/getStoreLevelCode")
    List<Store> getStoreLevelCode();

    @Override
    @RequestLine("POST /api/StoreService/getStoreCityList")
    List<Store> getStoreCityList();

    @Override
    @RequestLine("POST /api/StoreService/getStoreCityList")
    List<Store> getStoreInStoreCodes(@Param("storeCodes") String storeCodes, @Param("restrictArea") String restrictArea);

    @Override
    @RequestLine("POST /api/StoreService/getRelationStoreListByNumber")
    List<Store> getRelationStoreListByNumber(@Param("storeQuery") StoreQuery storeQuery);

    /**
     * UserChangeService
     */
    @Override
    @RequestLine("POST /api/StoreService/getWorkUserInfo")
    List<UserChangeVO> getWorkUserInfo(@Param("userChangeBO") UserChangeBO userChangeBO);

    @Override
    @RequestLine("POST /api/StoreService/getManagerWorkInfo")
    List<UserChangeVO> getManagerWorkInfo(@Param("userChangeBO") UserChangeBO userChangeBO);

    @Override
    @RequestLine("POST /api/StoreService/getUserPostChangeInfo")
    Map<String, List<UserChangeVO>> getUserPostChangeInfo(@Param("userChangeBO") UserChangeBO userChangeBO);

    /**
     * UserRelationService
     */
    @Override
    @RequestLine("POST /api/StoreService/getUserRelations")
    UserRelation getUserRelations(@Param("number") String number, @Param("relationType") Integer relationType);

    @Override
    @RequestLine("POST /api/StoreService/listUserRelations")
    List<UserRelation> listUserRelations(@Param("userRelationQuery") UserRelationQuery userRelationQuery,
                                         @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    /**
     * UserService
     */
    @Override
    @RequestLine("POST /api/UserService/getUser")
    User getUser(@Param("userCode") String userCode);

    @Override
    @RequestLine("POST /api/UserService/getUserByMobile")
    User getUserByMobile(@Param("merchantId") String merchantId, @Param("mobile") String mobile);

    @Override
    @RequestLine("POST /api/UserService/getUserByNumber")
    User getUserByNumber(@Param("merchantId") String merchantId, @Param("number") String number);

    @Override
    @RequestLine("POST /api/UserService/listUserByNumber")
    List<User> listUserByNumber(@Param("merchantId") String merchantId, @Param("numbers") List<String> numbers);

    @Override
    @RequestLine("POST /api/UserService/getUserByToken")
    User getUserByToken(@Param("token") String token);

    @Override
    @RequestLine("POST /api/UserService/getStoreManager")
    User getStoreManager(@Param("merchantId") String merchantId, @Param("storeCode") String storeCode);

    @Override
    @RequestLine("POST /api/UserService/listUserByStoreCode")
    List<User> listUserByStoreCode(@Param("merchantId") String merchantId, @Param("storeCode") String storeCode);

    @Override
    @RequestLine("POST /api/UserService/listUserByOrgId")
    List<User> listUserByOrgId(@Param("orgId") String orgId);

    @Override
    @RequestLine("POST /api/UserService/listUserByOrgId")
    PageData<User> listAllUserByOrgId(@Param("userQuery") UserQuery userQuery, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    @Override
    @RequestLine("POST /api/UserService/allUserByOrgId")
    List<User> allUserByOrgId(@Param("userQuery") UserQuery userQuery, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    @Override
    @RequestLine("POST /api/UserService/selectUserListByOrgCodeAndUserName")
    List<User> selectUserListByOrgCodeAndUserName(@Param("userEntity") User userEntity);

    @Override
    @RequestLine("POST /api/UserService/listAllUserByOrgId")
    List<User> listAllUserByOrgId(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listUserAllByMerchantId")
    List<User> listUserAllByMerchantId(@Param("merchantId") String merchantId);

    @Override
    @RequestLine("POST /api/UserService/listUserAllByMerchantId")
    List<User> listUserAllByMerchantId(@Param("merchantId") String merchantId, @Param("lastModify") String lastModify);

    @Override
    @RequestLine("POST /api/UserService/listUserByMerchantId")
    PageResult<User> listUserByMerchantId(@Param("userQuery") UserQuery userQuery, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    @Override
    @RequestLine("POST /api/UserService/listUserByMerchantId")
    PageResult<User> listUserByMerchantId(@Param("userQuery") UserQuery userQuery, @Param("merchantId") String merchantId, @Param("pageNo") Integer pageNo,
                                          @Param("pageSize") Integer pageSize);

    @Override
    @RequestLine("POST /api/UserService/listUserByFuzzy")
    PageResult<User> listUserByFuzzy(@Param("userQuery") UserQuery userQuery, @Param("merchantId") String merchantId, @Param("pageNo") Integer pageNo,
                                     @Param("pageSize") Integer pageSize);

    @Override
    @RequestLine("POST /api/UserService/listUserByOrgPost")
    List<User> listUserByOrgPost(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listUserByOrgPostPage")
    PageData<User> listUserByOrgPostPage(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listUserByStoreCode")
    List<User> listUserByStoreCode(@Param("userQuery")UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listUserByStoreCodeUP")
    List<User> listUserByStoreCodeUP(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listUserByOrgCodeUP")
    List<User> listUserByOrgCodeUP(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listUserAllByStoreCode")
    List<User> listUserAllByStoreCode(@Param("merchantId") String merchantId, @Param("storeCodeList") List<String> storeCodeList);

    @Override
    @RequestLine("POST /api/UserService/listOrgUserByUserQuery")
    Map<String, List> listOrgUserByUserQuery(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/getUserInfoByNumber")
    User getUserInfoByNumber(@Param("number") String number);

    @Override
    @RequestLine("POST /api/UserService/getUserHeadPortrait")
    User getUserHeadPortrait(@Param("number") String number);

    @Override
    @RequestLine("POST /api/UserService/getUserByRoleCode")
    List<User> getUserByRoleCode(@Param("roleCode") String roleCode);

    @Override
    @RequestLine("POST /api/UserService/getShopManagerByCode")
    User getShopManagerByCode(@Param("storeCode") String storeCode);

    @Override
    @RequestLine("POST /api/UserService/verifyPasswordForAD")
    Boolean verifyPasswordForAD(@Param("number") String number, @Param("passWord") String passWord);

    @Override
    @RequestLine("POST /api/UserService/selectManagerListParams")
    List selectManagerListParams(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/selectUserLevelListParams")
    List selectUserLevelListParams(@Param("userQuery") UserQuery userQuery);

    @Override
    @RequestLine("POST /api/UserService/listBusJoinInfo")
    List<BusJoinResponse> listBusJoinInfo(@Param("busJoinQuery") BusJoinQuery busJoinQuery);

    @Override
    @RequestLine("POST /api/UserService/getADUser")
    List<User> getADUser(@Param("number") String number);
}
